
#include "VFVFaceKernel.h"

registerMooseObject("O4App", VFVFaceKernel);

template <>
InputParameters
validParams<VFVFaceKernel>()
{
  InputParameters params = validParams<DGKernel>();
  return params;
}

VFVFaceKernel::VFVFaceKernel(const InputParameters & parameters)
  : DGKernel(parameters)
{
}

Real VFVFaceKernel::computeQpResidual(Moose::DGResidualType type)
{
  Real r = 0;

  RealGradient _velocity = RealGradient(1,0,0);
  Real vdotn = _velocity * _normals[_qp];


  switch (type)
  {
    case Moose::Element:
      r = (_u[_qp] - _u_neighbor[_qp])*_test[_i][_qp];
      break;

    case Moose::Neighbor:
      r = -(_u[_qp] - _u_neighbor[_qp])*_test_neighbor[_i][_qp];
      break;
  }

  return r;
}

Real VFVFaceKernel::computeQpJacobian(Moose::DGJacobianType type)
{
   Real r = 0;


  switch (type)
  {
    case Moose::ElementElement:
      r = _test[_i][_qp] * _phi[_j][_qp];
      break;

    case Moose::ElementNeighbor:
      r = -_test[_i][_qp] * _phi_neighbor[_j][_qp];
      break;

    case Moose::NeighborElement:
      r = -_test_neighbor[_i][_qp] * _phi[_j][_qp];
      break;

    case Moose::NeighborNeighbor:
      r = _test_neighbor[_i][_qp] * _phi_neighbor[_j][_qp];
      break;
  }

  return r;
}
